package com.hgh.model;

import com.hgh.util.GenerateEnemyTank;
import com.hgh.util.Node;
import com.misakubex.Main;

/**
 * @author hgh
 */
public class EnemyTank extends Tank {

    public EnemyTank(){
        this.setEnemy(true);
    }

    /**
     *  出生点标记，三个出生点分别为1，2，3
     */
    private int bornMark;

    /**
     *  出生位置
     */
    private int[] bornPoint;

    /**
     * 目标的位置
     */
    private int[] targetPoint;

    public static boolean isAlive(EnemyTank enemyTank) {
        boolean alive = false;
        //判断坦克是否还活着
        for (int index = 1; index <= 3; index++) {
            if (GenerateEnemyTank.getEnemyTankList(index).contains(enemyTank)) {
                alive = true;
            }
        }
        return alive;
    }


    public void move(){

        switch (this.getDirct()){
            case 'w': this.moveUp();break;
            case 's': this.moveDown();break;
            case 'a': this.moveLeft();break;
            case 'd': this.moveRight();break;
            default:break;
        }
    }


    public int getBornMark() {
        return bornMark;
    }

    public void setBornMark(int bornMark) {
        this.bornMark = bornMark;
    }

    public int[] getBornPoint() {
        return bornPoint;
    }

    public void setBornPoint(int[] bornPoint) {
        this.bornPoint = bornPoint;
    }

    public int[] getTargetPoint() {
        return targetPoint;
    }

    public void setTargetPoint(int[] targetPoint) {
        this.targetPoint = targetPoint;
    }
}
